<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>事件处理</title>
</head>
<body>
<button id="app" v-on:click="myfunction()">
    点我呀
</button>
<h5>双向绑定</h5>
<div id="app-6">
    <p>{{ message }}</p>
    <input v-model="message">
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script type="text/javascript">
    var vm=new Vue({
        el:'#app',
        data:{
            product:{
                id:1,
                name:"联想拯救者电脑"
            }
        },
        methods:{
            myfunction: function (event) {
                alert(this.product.id+":"+this.product.name);

            }
        }
    })
    var app6 = new Vue({
        el: '#app-6',
        data: {
            message: 'Hello Vue!'
        }
    })
</script>
</body>
</html>